package beans;

import database.DBController;
import domain.Paper;
import java.io.Serializable;
import java.sql.SQLException;
import java.util.List;
import javax.faces.model.SelectItem;


public class JudgeBean implements Serializable {

    DBController dbc = new DBController();
    protected Paper p = new Paper();
 
    public Paper getPaper() {
        return p;
    }

    public JudgeBean() throws SQLException {

    }

    public String savePaperChanges() throws SQLException
    {
        System.out.printf("...........p.getPaper_ID():%d \n",p.getPaper_ID());
        dbc = new DBController();
        dbc.saveChangesFromJudge(this.p);
        return "true";
    }



//    public List<SelectItem> getTypes() throws SQLException {
//        dbc = new DBController();
//        return dbc.getTypes();
//    }
//
//    public List<SelectItem> getPlaces() throws SQLException {
//        dbc = new DBController();
//        return dbc.getPlaces();
//    }

    public List<SelectItem> getPapers() throws SQLException {

        dbc = new DBController();
        return dbc.getPapers();
    }
}
